//
//  TravelStrokeOneTableViewCell.m
//  ToWhere
//
//  Created by dllo on 15/11/18.
//  Copyright © 2015年 www.TE.com. All rights reserved.
//

#import "TravelStrokeOneTableViewCell.h"
#import "TravelTopicDetailsOneTableViewCell.h"

@interface TravelStrokeOneTableViewCell ()

@property (nonatomic, retain) UILabel *labelTitle;

//今日备忘
@property (nonatomic, retain) UILabel *labelMemo;

@property (nonatomic, retain) UIView *viewO;

@end


@implementation TravelStrokeOneTableViewCell

-(void)dealloc
{
    [_labelMemo release];
    
    [_labelMemo release];
    [_model release];
    [_viewO release];
    [super dealloc];
    
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createView];
        
    }
    
    return self;
}

-(void)createView
{
    self.labelTitle = [[UILabel alloc]init];
    
    self.labelTitle.textColor = [UIColor blackColor];
    
    self.labelTitle.font = [UIFont systemFontOfSize:17 *kWidth];
    
    [self addSubview:self.labelTitle];
    [_labelTitle release];
    
    
    self.labelMemo = [[UILabel alloc]init];
    self.labelMemo.textColor = [UIColor lightGrayColor];
    
    self.labelMemo.font = [UIFont systemFontOfSize:14 *kWidth];
    self.labelMemo.numberOfLines = 0;
    [self addSubview:self.labelMemo];
    
    [_labelMemo release];
    
    self.viewO = [[UIView alloc]init];
    self.viewO.backgroundColor = [UIColor colorWithRed:0.882 green:0.882 blue:0.902 alpha:1];
    
    [self addSubview:self.viewO];
    [_viewO release];
    
    
}

-(void)setModel:(TravelStrokeMiddleModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    self.labelMemo.text = model.memo;
    
    self.labelTitle.text = @"今日备忘";
    
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.labelTitle.frame = CGRectMake(10 *kWidth, 10 *kHeight, self.frame.size.width - 20 *kWidth, 20 *kHeight);
    
    self.labelMemo.frame = CGRectMake(10 *kWidth, 40 *kHeight, self.frame.size.width - 20 *kWidth, [TravelTopicDetailsOneTableViewCell heightOfLabel:self.model.memo andTextFont:[UIFont systemFontOfSize:12 *kWidth] andTextWidth:self.frame.size.width - 20 *kWidth]);
    
    self.viewO.frame = CGRectMake(5 *kWidth, self.labelMemo.frame.origin.y + self.labelMemo.frame.size.height + 5 *kHeight, self.frame.size.width - 10 *kWidth, 4 *kHeight);
    
}





/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
